<h1>Trainings List</h1>

<table>
  <thead>
    <tr>
      <th>Id</th>
      <th>Name</th>
      <th>Description</th>
      <th colspan="7">Steps</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($trainings as $training): ?>
    <tr>
      <td><a href="<?php echo url_for('training/edit?id='.$training->getId()) ?>"><?php echo $training->getId() ?></a></td>
      <td><?php echo $training->getName() ?></td>
      <td><?php echo $training->getDescription() ?></td>
      <?php foreach ($training->ProgramSteps as $programSteps): ?>
          <td><?php echo "<h2>{$programSteps->getStep()}</h2><b>{$programSteps->Circuit->getName()}</b><br><i>{$programSteps->Circuit->getDescription()}</i>" ?></td>
      <?php endforeach; ?>   
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>

  <a href="<?php echo url_for('training/new') ?>">New</a>
